<?php
session_start();
$user=$_SESSION['user'];

if (!empty($user)){
	
	$conexion=mysql_connect("localhost", "root", "") or die ("Error al Conectar!");
	mysql_select_db("hazarte") or die ("Verifique la Base de Datos");
	
	$sql = "SELECT COUNT(*) FROM  `usuarios` WHERE  `usuario` =  '$user'";
	$resultado = mysql_query($sql);
	$msg = mysql_fetch_row($resultado);
	
	if  ($msg[0] == 1){

		?>
		<!doctype html>
		<html  lang =  "es">
			<head>
				<meta charset="utf-8">
				<meta name="autor" content="jaimelopez">
				<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
				
				<link href="../libs/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
				<link href="../css/estilo.css" rel="stylesheet" type="text/css">
		
				<script src="../libs/jquery/jquery_1.11.js" type="text/javascript"></script> 
				<script src="../libs/bootstrap/js/bootstrap.js" type="text/javascript"></script>
				<script src="../js/funcionalidad.js" type="text/javascript"></script> 
			    
			</head>
				
			<body id="bodyClass">
		
				<div class="col-md-8 col-md-offset-2">
					<div class="page-header" style="text-align:center;">
						<h2>Administraci&oacute;n Haz Arte</h2>
					</div>
					<form action="insert.php" id="form" method="post" enctype="multipart/form-data">
					  <div class="input-group">
					    <span class="input-group-addon">Nombre de la foto</span>
					    <input type="text" class="form-control" id="nombreFoto" name="nombreFoto">
					  </div><br>
					  
					   <div class="input-group">
					    <span class="input-group-addon">Dimensiones</span>
					    <input type="text" class="form-control" id="dimensiones" name="dimensiones">
					  </div><br>
					   
					  <div class="input-group">
					    <span class="input-group-addon">Precio</span>
					    <input type="text" class="form-control" id="precio" name="precio">
					  </div><br>
					   
					  <div class="input-group">
					    <span class="input-group-addon">Material</span>
					    <input type="text" class="form-control" id="material" name="material">
					  </div><br>
					  
					  <div class="input-group">
						  <span class="input-group-addon">Tipo de imagen</span>
						  <select class="form-control" name="tipo" id="tipo">
							  <option value="escultura">Escultura Creativa</option>
							  <option value="reproduccion">Reproducci&oacute;nes</option>
							  <option value="complemento">Complementos</option>
							  <option value="empresa">Empresas</option>
						  </select>
					   </div><br>
		
					   <div class="input-group">
					    <span class="input-group-addon">Descripci&oacute;n</span>
					    <textarea class="form-control" rows="3" id="descripcion" name="descripcion"></textarea>
					  </div><br>
					 
					 <div class="input-group">
						<label>Subir imagen</label>
					    <input id="img" name="archivo" type="file" accept="image/jpg, image/gif, image/jpeg, image/png">
					  </div>
					 
					  <div class="modal-footer" style="text-align:center;">
						        <button type="submit" id="enviar" class="btn btn-primary btn-lg" style="float:left">Enviar</button>
					  		    <a href="administrar.php" class="btn btn-primary btn-lg" style="float:right">Volver</a>
					  </div>
			
					</form>
				</div>
			</body>
		</html>	
	
<?php 
	}else{
		header('Location: error.html');
	}
}else{
	header('Location: error.html');
}

?>


